home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / DSAT_ANA / DSAT.H < prev    next >
Text File  |  1988-11-02  |  2KB  |  93 lines

  1. /*
  2.     System error alert table editor
  3.     "DSAT.h"
  4. */
  5.  
  6. enum {
  7.     type_unknown,
  8.     type_alert,        /* Alert definition */
  9.     type_text,        /* Text definition */
  10.     type_icon,        /* Icon definition */
  11.     type_button,    /* Button definition */
  12.     type_string,    /* String drawn in button definition */
  13.     type_code        /* Procedure definition */
  14. };
  15.  
  16. #define HEADER                    /* Header for all definition records */    \
  17.     int id;                        /* Definition id */                        \
  18.     int    length;                    /* Length of rest of definition */
  19.  
  20. typedef struct {                /* Unidentified definition */
  21.     HEADER
  22.     char data[2];
  23. } UNKNOWN;
  24.  
  25. typedef struct {                /* Alert definition */
  26.     HEADER
  27.     int text1;                    /* Primary text definition id */
  28.     int text2;                    /* Secondary text definition id */
  29.     int icon;                    /* Icon definition id */
  30.     int code;                    /* Procedure definition id */
  31.     int button;                    /* Button definition id */
  32. } ALERT;
  33.  
  34. typedef struct {                /* Text definition */
  35.     HEADER
  36.     Point location;                /* Location of text (global coordinates) */
  37.     char text[2];                /* NUL terminated character string */
  38. } TEXT;
  39.  
  40. typedef struct {                /* Icon definition */
  41.     HEADER
  42.     Rect location;                /* Location of icon (global coordinates) */
  43.     char icon[128];                /* Icon data */
  44. } ICON;
  45.  
  46. typedef struct {                /* Procedure definition */
  47.     HEADER
  48.     char code[2];                /* Procedure code */
  49. } CODE;
  50.  
  51. typedef struct {                /* Button */
  52.     int string;                    /* String id */
  53.     Rect location;                /* Button location */
  54.     int code;                    /* Procedure definition id */
  55. } BUTTON;
  56.  
  57. typedef struct {                /* Button definition */
  58.     HEADER
  59.     int buttons;                /* Number of buttons */
  60.     BUTTON button[1];
  61. } BUTTONS;
  62.  
  63. typedef struct {                /* String drawn in button definition */
  64.     HEADER
  65.     char string[2];                /* Text (length characters) */
  66. } STRING;
  67.  
  68. typedef union {                    /* Definition from alert table */
  69.     UNKNOWN u;
  70.     ALERT a;
  71.     TEXT t;
  72.     ICON i;
  73.     CODE c;
  74.     BUTTONS b;
  75.     STRING s;
  76. } DEFINITION, *DEFINITION_PTR;
  77.  
  78. typedef struct {                /* Alert table */
  79.     int count;                    /* Number of definitions + 1 in table */
  80.     DEFINITION definition[1];    /* Definitions */
  81. } TABLE, *TABLE_PTR, **TABLE_HDL;
  82.  
  83. typedef struct {                /* Information about definition */
  84.     int type;                    /* Type of definition */
  85.     int flag;                    /* Further information */
  86.     DEFINITION_PTR definition;    /* Adress into alert table */
  87. } TYPE, *TYPE_PTR, **TYPE_HDL;
  88.  
  89. typedef int (* PFI)();            /* Pointer to function returning int */
  90.  
  91. extern Ptr DSAlertTab: 0x2BA;    /* System error alert table */
  92. extern Rect DSAlertRect: 0x3F8;    /* Display rectangle for error alerts */
  93.